package com.project.frba.bifront.client.model;

import java.util.Map;

import com.google.gwt.user.client.rpc.IsSerializable;

public abstract class ChartInformation implements IsSerializable{

	private String descriptorName;
	private String title;
	private Boolean includeLegend;
	private String columnPropertyName;
	private String rowPropertyName;
	private String sql;
	
	public String getDescriptorName() {
		return descriptorName;
	}
	public void setDescriptorName(String descriptorName) {
		this.descriptorName = descriptorName;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Boolean getIncludeLegend() {
		return includeLegend;
	}
	public void setIncludeLegend(Boolean includeLegend) {
		this.includeLegend = includeLegend;
	}
	public String getColumnPropertyName() {
		return columnPropertyName;
	}
	public void setColumnPropertyName(String columnPropertyName) {
		this.columnPropertyName = columnPropertyName;
	}
	public String getRowPropertyName() {
		return rowPropertyName;
	}
	public void setRowPropertyName(String rowPropertyName) {
		this.rowPropertyName = rowPropertyName;
	}
	public String getSql() {
		return sql;
	}
	public void setSql(String sql) {
		this.sql = sql;
	}
	
	public String toString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append("descriptorName:" + getDescriptorName() + ";");
		buffer.append("title:" + getTitle() + ";");
		buffer.append("includeLegend:" + getIncludeLegend() + ";");
		buffer.append("columnPropertyName:" + getColumnPropertyName() + ";");
		buffer.append("rowPropertyName:" + getRowPropertyName() + ";");
		buffer.append("sql:" + getSql() + ";");
		
		return buffer.toString(); 
	}
	
	public void build(Map<String, String> info){
		this.setDescriptorName(info.get("descriptorName"));
		this.setIncludeLegend(new Boolean(info.get("includeLegend")));
		this.setRowPropertyName(info.get("rowPropertyName"));
		this.setColumnPropertyName(info.get("columnPropertyName"));
		this.setTitle(info.get("title"));
		this.setSql(info.get("sql"));	
	} 
	
}
